<%= render :partial => 'left_bar', :locals => { :on => 1 } %>

<div id="main">
  <div class="box">
    <form class="border p10 th" action="/dictionaries" method="get">
      <label>编号：
        <input type="text" name="id" value="<%= params[:id] %>"/>
      </label>
      &nbsp;&nbsp;
      <label>单词：
        <input type="text" name="word" value="<%= params[:word] %>"/>
      </label>
      &nbsp;&nbsp;
      <label>类型：
        <%= select_tag :flag, options_for_select(Dictionary.flag_options.unshift(['全部', '']), params[:flag].blank? ? nil : params[:flag].to_i) %>
      </label>
      &nbsp;&nbsp;
      <input class="submit btt90 bttb" type="submit" value="查询" />
    </form>
  </div>

  <div class="box">
    <% form_for :dictionary, :url => update_status_dictionaries_path, :html => { :method => :put } do |f| -%>
    <table width="96%" class="table border">
      <tr>
        <td height="35" colspan="9">
          <%= hidden_field_tag :status -%>
          <a class="btt bttb update_status" rel="-1">删除</a>
          <%= link_to '导出', dictionaries_url(:csv, :params => params), :class => 'btt bttb' -%>
        </td>
      </tr>
      <tr>
        <th width="15"><input type="checkbox" id="check_all"></th>
        <th width="38">编号</th>
        <th>词库</th>
        <th width="60">类型</th>
        <th width="48">权重</th>
        <th width="48">状态</th>
        <th width="120">创建时间</th>
        <th width="120">修改时间</th>
      </tr>
      <% for dictionary in @dictionaries %>
        <tr class="<%= cycle('', 'tr2') %>">
          <td><input type="checkbox" class="check" name="ids[]" value="<%= dictionary.id %>"></td>
          <td><%= dictionary.id %></td>
          <td><%= link_to dictionary, edit_dictionary_path(dictionary) %></td>
          <td><%= dictionary.display_flag %></td>
          <td><%= dictionary.rank %></td>
          <td><%= dictionary.status %></td>
          <td><%= dictionary.created_at %></td>
          <td><%= dictionary.updated_at %></td>
        </tr>
      <% end -%>
    </table>
    <% end -%>
  </div>
  <%= will_paginate @dictionaries -%>
  
</div>

<%= javascript_include_tag 'base' -%>
